<<<<<<< HEAD
package com.itheima.service;
=======
/*package com.itheima.service;
>>>>>>> cebc61dc7c2086549f6b7e3e5922bd595f26ae10

import com.alibaba.dubbo.config.annotation.Service;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.itheima.dao.ReservationDao;
import com.itheima.entity.PageResult;
import com.itheima.entity.QueryPageBean;
import com.itheima.entity.Result;
import com.itheima.pojo.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@Service(interfaceClass = ReservationService.class)
@Transactional
public class ReservationServiceImpl implements ReservationService {
    @Autowired
    private ReservationDao reservationDao;

    @Override
    public PageResult findPage(QueryPageBean pageBean) {
        Integer currentPage = pageBean.getCurrentPage();
        Integer pageSize = pageBean.getPageSize();
        String queryString = pageBean.getQueryString();
        String[] queryDate = pageBean.getQueryDate();
        String begin = null;
        String end = null;
        if (queryDate != null && queryDate.length > 0) {
            begin = queryDate[0];
            end = queryDate[1];
            System.out.println(begin + "==" + end);
        }
        String queryOrderType = pageBean.getQueryOrderType();
        String queryOrderStatus = pageBean.getQueryOrderStatus();
        //使用分页助手插件实现分页查询
        PageHelper.startPage(currentPage, pageSize);
        Map<String, String> conditions = new HashMap<>();
        conditions.put("queryString", queryString);
        conditions.put("begin", begin);
        conditions.put("end", end);
        conditions.put("queryOrderType", queryOrderType);
        conditions.put("queryOrderStatus", queryOrderStatus);
        Page<Map<String, Object>> page = reservationDao.findByCondition(conditions);
        return new PageResult(page.getTotal(), page.getResult());
    }

    @Override
    public Order findById(Integer id) {
        return reservationDao.findById(id);
    }

    @Override
    public void edit(Map map) {
        reservationDao.edit(map);
    }

    @Override
    public void deleteById(Integer id) {
        reservationDao.deleteById(id);
    }
<<<<<<< HEAD
}
=======
}*/
>>>>>>> cebc61dc7c2086549f6b7e3e5922bd595f26ae10
